From 12f84610d1a336c82116c4a3b9f0dfe6aebf9add Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Thu, 11 Jan 2007 13:39:27 -0600 Subject: [PATCH] [POWERPC][LIBXC] Fix pointer math in ft_add_rsvmap(), rename string block to match DTC spec. Signed-off-by: Ryan Harper Signed-off-by: Hollis Blanchard --HG-- extra : transplant_source : %D6H%17U%AD%E6%FB%E7-%8EQ%91%91%F1%21%60%F9%2C%D5%17 --- tools/libxc/powerpc64/flatdevtree.c | 7 +++++-- tools/libxc/powerpc64/flatdevtree.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/libxc/powerpc64/flatdevtree.c b/tools/libxc/powerpc64/flatdevtree.c index f7a44bad7f..275e0884a6 100644 --- a/tools/libxc/powerpc64/flatdevtree.c +++ b/tools/libxc/powerpc64/flatdevtree.c @@ -14,7 +14,7 @@ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Copyright Pantelis Antoniou 2006 - * Copyright (C) IBM Corporation 2006 + * Copyright IBM Corporation 2006, 2007 * 2006 (c) MontaVista, Software, Inc. * * Authors: Pantelis Antoniou @@ -209,7 +209,7 @@ void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size) ((u64 *) cxt->pres)[0] = cpu_to_be64(physaddr); /* phys = 0, size = 0, terminate */ ((u64 *) cxt->pres)[1] = cpu_to_be64(size); - cxt->pres += 18; /* advance */ + cxt->pres += 16; /* advance two u64s worth */ ((u64 *) cxt->pres)[0] = 0; /* phys = 0, size = 0, terminate */ ((u64 *) cxt->pres)[1] = 0; @@ -318,6 +318,9 @@ int ft_end_tree(struct ft_cxt *cxt) cxt->pstr_begin = cxt->p_begin + cxt->struct_size; cxt->pstr = cxt->pstr_begin + cxt->strings_size; + /* mark the size of string structure in bph */ + bph->size_dt_strings = cxt->strings_size; + return 0; } diff --git a/tools/libxc/powerpc64/flatdevtree.h b/tools/libxc/powerpc64/flatdevtree.h index 794bcd4f78..2167cae91c 100644 --- a/tools/libxc/powerpc64/flatdevtree.h +++ b/tools/libxc/powerpc64/flatdevtree.h @@ -40,7 +40,7 @@ struct boot_param_header { /* version 2 fields below */ u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ /* version 3 fields below */ - u32 dt_strings_size; /* size of the DT strings block */ + u32 size_dt_strings; /* size of the DT strings block */ }; struct ft_cxt { -- 2.30.2